﻿using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using ContactManagement.App_GlobalResources;

namespace ContactManagement.Models
{
    /// <summary>
    /// Datenmodell für das Ändern des Passworts
    /// </summary>
    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "CurrentPasswordRESX", ResourceType = typeof(AccountViews))]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessageResourceName = "PasswordLengthRESX", ErrorMessageResourceType = typeof(SystemMessages), MinimumLength = WebConstants.PasswordLength)]
        [DataType(DataType.Password)]
        [Display(Name = "NewPasswordRESX", ResourceType = typeof(AccountViews))]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "ConfirmNewPasswordRESX", ResourceType = typeof(AccountViews))]
        [Compare("NewPassword", ErrorMessageResourceName = "PasswordsDontMatchRESX", ErrorMessageResourceType = typeof(SystemMessages))]
        public string ConfirmPassword { get; set; }
    }
}